package com.service.wmt.impl;

import com.dao.RegistrationtypeDao;
import com.entity.Registrationtype;
import com.entity.RegistrationtypeExample;
import com.service.wmt.RegistrationtypeService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
@Service
@Transactional
public class RegistrationtypeImpl implements RegistrationtypeService {

    @Resource
    private RegistrationtypeDao registrationtypeDao;

    @Override
    public List<Registrationtype> findAll() {

        return registrationtypeDao.selectByExample(null);
    }

    @Override
    public List<Registrationtype> findByName(String registrationtype) {
        RegistrationtypeExample registrationtypeExample = new RegistrationtypeExample();
        RegistrationtypeExample.Criteria criteria = registrationtypeExample.createCriteria();
        criteria.andRegistrationtypeLike(registrationtype);
        List<Registrationtype> list=registrationtypeDao.selectByExample(registrationtypeExample);
        return list;
    }
}
